<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>奔跑的少年（动画）</title>
    <style>
        /*为什么我的动画是6人同时在奔跑？？
        老师的是一个人在奔跑？？？*/
        .box1{
            width:256xp;
            height:256px;
            margin:0 auto;
            background-image: url("./picture/5.png");
            animation: run 2s steps(6) infinite;
            z-index: 9999;
          
        }
        /*创建关键帧*/
        @keyframes run{
            from{
                background-position: 0 0;
            }
            to{
                background-position: -1536px 0;
            }
        }
    </style>
</head>
<body>
    <div class="box1"></div>
    
</body>
</html>